<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Calucate MD5</title>
<script src="../../jslib/md5.js"></script>
</head>
<body>
	MD5 js test.
	<script>
		// quick test
		 var input1 = "ABC";
		 var input2 = ["A","B","C"];
		 var input3 = [0x41, 0x42, 0x43];
		 alert(faultylabs.MD5(input1) == "902FBDD2B1DF0C4F70B4A5D23525E932");
		 alert(faultylabs.MD5(input2) == "902FBDD2B1DF0C4F70B4A5D23525E932");
		 alert(faultylabs.MD5(input3) == "902FBDD2B1DF0C4F70B4A5D23525E932");
		 
		 if (typeof ArrayBuffer != 'undefined') {
			// ArrayBuffer
			 var abuf = new ArrayBuffer(3)
			 var vu8  = new Uint8Array(abuf)
			 vu8[0] = 0x41; vu8[1] = 0x42; vu8[2] = 0x43
			 alert(faultylabs.MD5(abuf) == "902FBDD2B1DF0C4F70B4A5D23525E932")
			 
			// Typed Array Uint32Array
			 var au32  = new Uint32Array(1)
			 au32[0] = 0xDDCCBBAA 
			 alert(faultylabs.MD5(au32) == "CA6FFBF95B47864FD4E73F2601326304")
		 }
 		
	</script>
</body>
</html>